import numpy as np

y = np.array([0, 1, 0, 0])
p = np.array([0.3, 0.2, 0.1, 0.4])


def mean_squared_error(p, y):
    return np.sum(((p - y) ** 2) / y.shape[0])


print(mean_squared_error(p, y))
